<%--
  Created by IntelliJ IDEA.
  User: sofwin
  Date: 2021/7/13
  Time: 16:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%String path = request.getContextPath()+"/";%>
<!doctype html>
<html>
<head>
    <base href="<%=path%>">
    <title>编辑用户信息</title>
    <link href="bootstrap/css/bootstrap.min.css?v=3.3.7" rel="stylesheet">
    <%--    <link href="bootstrap/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">--%>
    <script type="text/javascript" src="bootstrap/js/jquery.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/plugins/layer/layer.min.js"></script>
    <link href="bootstrap/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="bootstrap/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="bootstrap/css/animate.css" rel="stylesheet">
    <link href="bootstrap/css/style.css?v=4.1.0" rel="stylesheet">
    <script type="text/javascript" src="bootstrap/js/ry.js"></script>
    <script type="text/javascript" src="bootstrap/js/plugins/validate/jquery.validate.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/plugins/validate/messages_zh.min.js"></script>

    <style>
    input{
        width:60%;
    }
</style>
</head>
<body>
<form class="form-horizontal" id="form1">
    <input type="hidden" name="roleId" value="${role.roleId}"/>
    <div class="form-group" style="position: relative">
        <label for="roleCode" class="col-sm-2 control-label">角色编号</label>
        <div class="col-sm-10" style="position: relative">
            <input type="text" class="form-control" id="roleCode" required value="${role.roleCode}" name="roleCode" placeholder="Email">
        </div>
    </div>
    <div class="form-group">
        <label for="roleName" class="col-sm-2 control-label">角色名称</label>
        <div class="col-sm-10">
            <input type="password" class="form-control" id="roleName" value="${role.roleName}" name="roleName" placeholder="Password">
        </div>
    </div>
    <div class="form-group">
        <label for="rolePermission" class="col-sm-2 control-label" >权限字符</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="rolePermission" value="${role.rolePermission}" name="rolePermission" placeholder="Password">
        </div>
    </div>
    <div class="form-group">
        <label for="roleSort" class="col-sm-2 control-label">排序</label>
        <div class="col-sm-10">
            <input type="number" class="form-control" id="roleSort" value="${role.roleSort}" name="roleSort" placeholder="Password">
        </div>
    </div>
    <div class="form-group">
        <label for="status" class="col-sm-2 control-label">状态</label>
        <div class="col-sm-10">
            <select class="form-control" name="status" id="status">
                <option value="1" <c:if test="${role.status==1}">selected</c:if>>启用</option>
                <option value="0" <c:if test="${role.status==0}">selected</c:if>>禁用</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="button" id="save" class="btn btn-default">
            <i class="fa fa-save"></i>
                保存</button>
            <button type="reset"  class="btn btn-default">
                <i class="fa fa-refresh"></i>
                重置</button>
        </div>
    </div>
</form>
</body>
<script>
    $(function(){
        $("#form1").validate({
            onkeyup: false,
            rules:{
                roleCode:"required"
            },
            messages:{
                roleCode:"请输入角色编号"
            }
        });
        $("#save").click(function(){
            if($("#form1").valid()){
            $.modal.saveWindow('role/save',$("form").serialize());
            }

        })
    })
</script>
</html>
